//
//  DEMConverter.h
//  dem-converter
//
//  Created by Giorgio Tino on 2/25/14.
//
//

#ifndef __dem_converter__DEMConverter__
#define __dem_converter__DEMConverter__

#include <stdio.h>
#include <plib/sg.h>

class DEMConverter
{
public:
    virtual ~DEMConverter();
    
    bool convert(const char* input, const char* output);
    sgFloat** load(const char* input, int* r, int* c, sgFloat* min, sgFloat* max);
    int saveAsPng(sgFloat** heightMap, int r, int c, sgFloat min, sgFloat max,  const char* output) const;
    void print(sgFloat** heightMap, int r, int c) const;
    void printVisited(bool** visited, int r, int c) const;
    void printBox(sgFloat** heightMap, int r, int c) const;
    
private:
    bool _isBorder(sgFloat** heightMap, bool** visited, int r, int c, int x, int y) const;
};

#endif /* defined(__dem_converter__DEMConverter__) */
